<template>
  <a href="#" data-target="html" class="scroll-to-target scroll-to-top"
    ><i class="fa fa-angle-up"></i
  ></a>
</template>

<script>
/* eslint-disable */
export default {
  name: "ScrollTop",
  mounted() {
    if ($(".scroll-to-target").length) {
      $(".scroll-to-target").on("click", function () {
        var target = $(this).attr("data-target");
        // animate
        $("html, body").animate(
          {
            scrollTop: $(target).offset().top,
          },
          1000
        );
        return false;
      });
    }
  },
};
</script>